#include <iostream>
#include <array>
#include <cmath>
#include <limits>

using namespace std;

static bool square_number(int n) {
    int r = static_cast<int>(sqrt(n));
    return r * r == n;
};

static void positive() {
    long double closest = 1.0;
    for (int i = 2; i <= 1000; ++i) {
        if (!square_number(i)) {
            long double r = cosl(M_PI * sqrtl(i));
            long double t0 = fabsl(r - 1);
            long double t1 = fabsl(r);
            long double t2 = fabsl(r + 1);
            long double t = min(min(t0, t1), t2);
            if (t < closest) {
                closest = t;
                cout << i << ' ' << t << endl;
            }
        }
    }
}

static void negative() {
    cout << "haven't find a way to calculate cosh(100)" << endl;
}

int main() {
    positive();
    negative();
}